package com.liush.srb.sms.controller;

import com.liush.srb.base.result.ResponseVo;
import com.liush.srb.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "短信发送模块")
//@CrossOrigin
@RestController
@RequestMapping("/api/sms")
public class SmsController {

    @Resource
    private SmsService smsService;

    @ApiOperation("发送短信")
    //mobile:发送短信的手机号码   type：发送的类型
    @GetMapping("sendSms/{mobile}/{type}")
    public ResponseVo sendSms(@PathVariable("mobile") String mobile,
                              @PathVariable("type") Integer type) {
        smsService.sendSms(mobile, type);
        return ResponseVo.ok().message("短信发送成功");
    }

}